import { Http } from '@/utils/Http.js'

export const OrderApi = {

	/**
	 * 创建订单
	 * @returns
	 */
	createOrder: (param) => {
		return Http.request({
			url: '/app/food/order/createOrder',
			method: 'post',
			data: param,
			showLoading:true,
			loadingText:'订单提交中...'
		})
	},

	/**
	 * 分页获取订单
	 * @returns
	 */
	getPage: (param) => {
		return Http.request({
			url: '/app/food/order/getPage',
			method: 'post',
			data: param
		})
	},

	/**
	 * 根据订单号查询订单信息
	 * @returns
	 */
	getOrderDetailByOrderNo: (param) => {
		return Http.request({
			url: '/app/food/order/getOrderDetailByOrderNo',
			method: 'get',
			data: param
		})
	},

	/**
	 * 取消订单
	 * @returns
	 */
	cancelOrder: (param) => {
		return Http.request({
			url: '/app/food/order/cancelOrder',
			method: 'get',
			data: param
		})
	},

	/**
	 * 删除订单
	 * @returns
	 */
	deleteOrder: (param) => {
		return Http.request({
			url: '/app/food/order/deleteOrder',
			method: 'get',
			data: param
		})
	},

	/**
	 * 完成订单
	 * @returns
	 */
	completeOrder: (param) => {
		return Http.request({
			url: '/app/food/order/completeOrder',
			method: 'get',
			data: param
		})
	},

	/**
	 * 菜品设置为已制作
	 * @returns
	 */
	orderGoodsStatusEnd: (id) => {
		return Http.request({
			url: '/app/food/order/orderGoodsStatusEnd',
			method: 'get',
			data: {orderGoodsId:id}
		})
	},

	/**
	 * 修改备注
	 * @returns
	 */
	updateOrderGoodsRemark: (data) => {
		return Http.request({
			url: '/app/food/order/updateOrderGoodsRemark',
			method: 'post',
			data: data
		})
	},


}
